import request from '@/utils/request'
/**
 * 获取所有部门信息
 * @returns
 */
export function getDepartment() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}
/**
 * 新增部门信息
 * @returns
 */
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}
/**
 * 根据id查询部门信息
 * @param {*} id
 * @returns 部门详情信息
 */
export function getDepartmentDetail(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'GET'
  })
}
/**
 * 根据id修改部门详情
 * @param {*} id
 * @returns
 */
export function updateDepartmentDetail(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
/**
 * 根据id删除部门
 * @param {*} id
 * @returns
 */
export function delDepartmentDetail(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
